<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> 

<style type="text/css">
ul.searchContent {
    display: block;
    height: 100px;
    overflow: hidden;
}
</style>
<form id="pagerForm" method="post" action="${pageContext.request.contextPath}/role/query">
    <input type="hidden" name="pageNum" value="1" />  
    <input type="hidden" name="numPerPage" value="${pageView.pageSize}" />
    <input type="hidden" name="name" value="${param.name}" />
</form>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/role/query" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>名称:</label>
				<input style="width:75px" type="text" name="name" value="${param.name}" />
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li>
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">检索</button>
						</div>
					</div>
				</li>
				<!-- <li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li> -->
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
	 			<option value="10" <c:if test="${pageView.pageSize==15}">selected</c:if>>10</option>
			</select>
			<span>条，共${pageView.rowCount}条</span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${pageView.rowCount}" numPerPage="${pageView.pageSize}" pageNumShown="10" currentPage="${pageView.pageNow}"></div>
	</div>
	<div class="panelBar">
		<ul class="toolBar">
			<sec:authorize ifAnyGranted="ROLE_sys_role_add">
				<li class=""><a target="navTab" href="${pageContext.request.contextPath}/role/addUI" class="add"><span>添加</span></a></li>
				<li class="line">line</li>
			</sec:authorize>
			<sec:authorize ifAnyGranted="ROLE_sys_res_edit">
				<li class=""><a warn="请选择一条数据" target="navTab" href="${pageContext.request.contextPath}/role/getById?roleId={roleId}&typeKey=1" class="edit"><span>修改</span></a></li>
				<li class="line">line</li>
			</sec:authorize>
			<sec:authorize ifAnyGranted="ROLE_sys_role_delete">
				<li><a warn="请选择一条数据" title="确定要删除吗？" target="ajaxTodo" href="${pageContext.request.contextPath}/role/deleteById?roleId={roleId}" class="delete"><span>删除</span></a></li>
				<li class="line">line</li>
			</sec:authorize>
			<sec:authorize ifAnyGranted="ROLE_sys_role_permissions">
				<li><a target="navTab" href="${pageContext.request.contextPath}/resources/permissioRole?roleId={roleId}" class="icon"><span>分配权限</span></a></li>
				<li class="line">line</li>
			</sec:authorize>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="80">角色名</th>
				<th width="80">角色KEY</th>
				<th width="80">是否禁用</th>
				<th width="80">描述</th>
          </tr>
		</thead>
		<tbody>
			<c:forEach items="${pageView.records}" var="bean" varStatus="status">
				<tr target="roleId" rel="${bean.id}">
					<td>${bean.name}</td>
					<td>${bean.roleKey}</td>
					<td>
						<span class="STYLE1">
				            <c:if test="${bean.enable eq '0'}">
				            	<font color="red">禁用</font>
				            </c:if>
				            <c:if test="${bean.enable eq '1'}">
				            	<font color="blue">正常</font>
				            </c:if>
			            </span>
					</td>
					<td>${bean.description}</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
